home *** CD-ROM | disk | FTP | other *** search
/ El Mac 9 / El Mac 9.iso / Shareware / Applications / MathPad 2.4 / Examples / Loan Payment < prev    next >
Encoding:
Text File  |  1996-03-25  |  873 b   |  23 lines  |  [TEXT/MPad]

  1. -- This calculates the MonthlyPayment required to pay off an
  2. -- AmountBorrowed at an AnnualPercentageRate in equal monthly payments
  3. -- for a number of Years.  See also: "finance" XFun.
  4.  
  5. MonthlyPayment(AmountBorrowed,AnnualPercentageRate,Years):805.59
  6. AmountBorrowed=100000; AnnualPercentageRate=7.5; Years=20
  7.  
  8. MonthlyPayment(Amount,Rate,Years)=Amount*installment(Rate/1200,Years*12)
  9.  
  10. -- Show how the MonthlyPayment changes with the term.
  11. plot MonthlyPayment(AmountBorrowed,AnnualPercentageRate,X)
  12. Xmin=5; Xmax=30; Ymin=0;  Ymax=AmountBorrowed/50
  13.  
  14. -- Baseline is interest payment only (no reduction of principal).
  15. plot AmountBorrowed*AnnualPercentageRate/1200
  16.  
  17. -- installment required to amortize 1 in n periods
  18. -- at interest rate of i per period
  19. installment(i,n)=s(i,n)*i/(s(i,n)-1)
  20.  
  21. -- amount of 1 compounded at interest rate of i per period for n periods
  22. s(i,n)=(1+i)^n
  23.